define(['durandal/app','knockout'],function(app,ko){
	function exports(name){
		this.name=ko.observable(name);
		this.message = ko.observable();
		this.canPublish = ko.computed(function () {
			return this.message() ?true:false;
		},this);
	}
	exports.prototype.publish=function () {
		app.trigger('event:message',this.name()+':'+this.message())
	}
	return exports;
})